package com.facebook.app.client.event;

import java.util.List;

import com.facebook.app.shared.clustering.Clusterable;
import com.google.gwt.event.shared.GwtEvent;

public class ClusteringEndedEvent extends GwtEvent<ClusteringEndedEventHandler> {
	
	public static final Type<ClusteringEndedEventHandler> TYPE = new Type<ClusteringEndedEventHandler>();
	
	private List<Clusterable> clusteringResults;
	
	public ClusteringEndedEvent(List<Clusterable> clusteringResults) {
		this.clusteringResults = clusteringResults;
	}
	
	public List<Clusterable> getClusteringResults() {
		return clusteringResults;
	}
	
	@Override
	public Type<ClusteringEndedEventHandler> getAssociatedType() {
		return TYPE;
	}
	
	@Override
	protected void dispatch(ClusteringEndedEventHandler handler) {
		handler.onClusteringEnded(this);
	}

}
